<style type="text/css">
    .tablelist td{line-height:26px;}
    .tablelist tbody tr.odd {background:#E3F0FA}
</style>
<form class="form-inline" method="get">
    <div class="form-group col-xs-2">
        <div class="col-xs-12">
            <input class="form-control" name="realname" value="{$realname}"
                   placeholder="用户名或真实姓名">
        </div>
    </div>
    <div class="form-group col-xs-2">
        <div class="col-xs-12">
            <button type="submit" class="btn btn-success">
                确认搜索
            </button>
        </div>
    </div>
</form>
<hr>
<table class="table table-striped">
    <thead>
    <tr>
        <td>编号</td>
        <td>用户名</td>
        <td>真实姓名</td>
        <td>投诉内容</td>
        <td>投诉图片</td>
        <td>提交时间</td>
        <th>当前状态</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody class="tbodycon">
    {volist name="list.data" id="item"}
    <tr>
        <td>{$item.id}</td>
        <td>{$item.uid|get_uname}</td>
        <td>{$item.uid|get_realname}</td>
        <td>
            {if condition="$item['content'] neq ''"}
                <a title="{$item.content}">点击查看</a>
            {else}
            无
            {/if}
        </td>
        <td>
            {if condition="$item['imgurl'] neq ''"}
                <img src="{$item.imgurl}" style='width:50px;height:50px;' />
                {else /}
                无
            {/if}
        </td>
        <td>
            {$item.ctime|date='Y-m-d H:i:s',###}
        </td>
        <td>
            {if condition="$item['status'] eq 1"}未处理{/if}
            {if condition="$item['status'] eq 2"}已处理{/if}
        </td>
        <td>
            {if condition="$item['status'] eq 1"}
            <a href="javascript:void(0)" style="color:#009688;"  data-toggle="confirm"
               data-title="操作"
               data-content="确认要设为已操作吗？"
               data-url="{:url('changestatus',array('id'=>$item['id'],'status'=>2))}">
               设为已操作
            </a>
            {/if}
            {if condition="$item['status'] eq 2"}
            <a href="javascript:void(0)"  style='color:#333;' data-toggle="confirm"
               data-title="操作"
               data-content="确认要设为未操作吗？"
               data-url="{:url('changestatus',array('id'=>$item['id'],'status'=>1))}">
              设为未操作
            
            </a>
            {/if}
        </td>
    </tr>
    {/volist}
    </tbody>
</table>

<div class="row">
    <div class="col-xs-12" style="text-align: right;">
        {$page}
    </div>
</div>
<script src="__PUBLIC__/vendors/select2/js/select2.min.js"></script>
<script type="text/javascript">
    $('.tablelist tbody tr:odd').addClass('odd');
    $(function(){
        $('.tbodycon a').click(function(){
            var con = $(this).attr('title');
            layer.alert(con);
        });
        $('.tbodycon span').click(function(){
            var con = $(this).attr('href');
            location.href= con;
        });
        $('.tbodycon img').click(function(){
            var src = $(this).attr('src');
            var srcimg = "<div style='text-align:center;'><img src='"+src+"'></div>";
            layer.open({
                type: 1,
                title:'投诉照片',
                skin: 'layui-layer-demo',
                closeBtn: 2,
                shadeClose: false,
                anim: 2,
                btn:'关闭',
                area: ['60%', '60%'],
                shadeClose: true, //开启遮罩关闭
                content: srcimg
            });

        });
    })
</script>

